Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fsevent: return error on canonicalize failure #369

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

jmagnuson
Copy link
Contributor

Removes a panic that can occur in append_path when a file is removed
after passing the exists check, but before canonicalization. This
change moves canonicalize before appending the path, so that it can
safely bail on error without leaking state.

Fixes #368.

Removes a panic that can occur in `append_path` when a file is removed
after passing the `exists` check, but before canonicalization. This
change moves `canonicalize` before appending the path, so that it can
safely bail on error without leaking state.
src/fsevent.rs Show resolved Hide resolved
Copy link
Member

@0xpr03 0xpr03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the issue + PR, I think we want to catch this one case, otherwise it looks good. Whether or not path.exists should throw in that case is also something I may have to change, but that's for another PR.

@0xpr03 0xpr03 merged commit 07809b9 into notify-rs:main Nov 22, 2021
@jmagnuson jmagnuson deleted the fix/panic-on-missing-file-race branch November 22, 2021 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic in FSEvents when canonicalizing missing path
3 participants